home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / sgelsy.z / sgelsy
Encoding:
Text File  |  2002-10-03  |  7.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SGELSY - compute the minimum-norm solution to a real linear least squares
  10.      problem
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE SGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, WORK,
  14.                         LWORK, INFO )
  15.  
  16.          INTEGER        INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
  17.  
  18.          REAL           RCOND
  19.  
  20.          INTEGER        JPVT( * )
  21.  
  22.          REAL           A( LDA, * ), B( LDB, * ), WORK( * )
  23.  
  24. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  25.      These routines are part of the SCSL Scientific Library and can be loaded
  26.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  27.      directs the linker to use the multi-processor version of the library.
  28.  
  29.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  30.      4 bytes (32 bits). Another version of SCSL is available in which integers
  31.      are 8 bytes (64 bits).  This version allows the user access to larger
  32.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  33.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  34.      only one of the two versions; 4-byte integer and 8-byte integer library
  35.      calls cannot be mixed.
  36.  
  37. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  38.      SGELSY computes the minimum-norm solution to a real linear least squares
  39.      problem:     minimize || A * X - B ||
  40.      using a complete orthogonal factorization of A.  A is an M-by-N matrix
  41.      which may be rank-deficient.
  42.  
  43.      Several right hand side vectors b and solution vectors x can be handled
  44.      in a single call; they are stored as the columns of the M-by-NRHS right
  45.      hand side matrix B and the N-by-NRHS solution matrix X.
  46.  
  47.      The routine first computes a QR factorization with column pivoting:
  48.          A * P = Q * [ R11 R12 ]
  49.                      [  0  R22 ]
  50.      with R11 defined as the largest leading submatrix whose estimated
  51.      condition number is less than 1/RCOND.  The order of R11, RANK, is the
  52.      effective rank of A.
  53.  
  54.      Then, R22 is considered to be negligible, and R12 is annihilated by
  55.      orthogonal transformations from the right, arriving at the complete
  56.      orthogonal factorization:
  57.         A * P = Q * [ T11 0 ] * Z
  58.                     [  0  0 ]
  59.      The minimum-norm solution is then
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))
  71.  
  72.  
  73.  
  74.         X = P * Z' [ inv(T11)*Q1'*B ]
  75.                    [        0       ]
  76.      where Q1 consists of the first RANK columns of Q.
  77.  
  78.      This routine is basically identical to the original xGELSX except three
  79.      differences:
  80.        o The call to the subroutine xGEQPF has been substituted by the
  81.          the call to the subroutine xGEQP3. This subroutine is a Blas-3
  82.          version of the QR factorization with column pivoting.
  83.        o Matrix B (the right hand side) is updated with Blas-3.
  84.        o The permutation of matrix B (the right hand side) is faster and
  85.          more simple.
  86.  
  87.  
  88. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  89.      M       (input) INTEGER
  90.              The number of rows of the matrix A.  M >= 0.
  91.  
  92.      N       (input) INTEGER
  93.              The number of columns of the matrix A.  N >= 0.
  94.  
  95.      NRHS    (input) INTEGER
  96.              The number of right hand sides, i.e., the number of columns of
  97.              matrices B and X. NRHS >= 0.
  98.  
  99.      A       (input/output) REAL array, dimension (LDA,N)
  100.              On entry, the M-by-N matrix A.  On exit, A has been overwritten
  101.              by details of its complete orthogonal factorization.
  102.  
  103.      LDA     (input) INTEGER
  104.              The leading dimension of the array A.  LDA >= max(1,M).
  105.  
  106.      B       (input/output) REAL array, dimension (LDB,NRHS)
  107.              On entry, the M-by-NRHS right hand side matrix B.  On exit, the
  108.              N-by-NRHS solution matrix X.
  109.  
  110.      LDB     (input) INTEGER
  111.              The leading dimension of the array B. LDB >= max(1,M,N).
  112.  
  113.      JPVT    (input/output) INTEGER array, dimension (N)
  114.              On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted to
  115.              the front of AP, otherwise column i is a free column.  On exit,
  116.              if JPVT(i) = k, then the i-th column of AP was the k-th column of
  117.              A.
  118.  
  119.      RCOND   (input) REAL
  120.              RCOND is used to determine the effective rank of A, which is
  121.              defined as the order of the largest leading triangular submatrix
  122.              R11 in the QR factorization with pivoting of A, whose estimated
  123.              condition number < 1/RCOND.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))                                                          SSSSGGGGEEEELLLLSSSSYYYY((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      RANK    (output) INTEGER
  141.              The effective rank of A, i.e., the order of the submatrix R11.
  142.              This is the same as the order of the submatrix T11 in the
  143.              complete orthogonal factorization of A.
  144.  
  145.      WORK    (workspace/output) REAL array, dimension (LWORK)
  146.              On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  147.  
  148.      LWORK   (input) INTEGER
  149.              The dimension of the array WORK.  The unblocked strategy requires
  150.              that:  LWORK >= MAX( MN+3*N+1, 2*MN+NRHS ), where MN = min( M, N
  151.              ).  The block algorithm requires that:  LWORK >= MAX(
  152.              MN+2*N+NB*(N+1), 2*MN+NB*NRHS ), where NB is an upper bound on
  153.              the blocksize returned by ILAENV for the routines SGEQP3, STZRZF,
  154.              STZRQF, SORMQR, and SORMRZ.
  155.  
  156.              If LWORK = -1, then a workspace query is assumed; the routine
  157.              only calculates the optimal size of the WORK array, returns this
  158.              value as the first entry of the WORK array, and no error message
  159.              related to LWORK is issued by XERBLA.
  160.  
  161.      INFO    (output) INTEGER
  162.              = 0: successful exit
  163.              < 0: If INFO = -i, the i-th argument had an illegal value.
  164.  
  165. FFFFUUUURRRRTTTTHHHHEEEERRRR DDDDEEEETTTTAAAAIIIILLLLSSSS
  166.      Based on contributions by
  167.        A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
  168.        E. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
  169.        G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
  170.  
  171.  
  172. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  173.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  174.  
  175.      This man page is available only online.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.